/**
 * This file is part of Sipana project <http://sipana.org/>
 *
 * Sipana is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 3 of the License.
 *
 * Sipana is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.sipana;

public class SipanaProperties {
    
    public static String getProperty(SipanaPropertyType p)
    {
        return System.getProperty(p.getKey(), p.getDefaultValue());
    }
    
    public static int getPropertyInt(SipanaPropertyType p) {
        return Integer.parseInt(getProperty(p));
    }
    
    public static float getPropertyFloat(SipanaPropertyType p) {
        return Float.parseFloat(getProperty(p));
    }
    
    public static double getPropertyDouble(SipanaPropertyType p) {
        return Double.parseDouble(getProperty(p));
    }
    
    public static void setProperty(SipanaPropertyType p, String value) {
        System.setProperty(p.getKey(), value);
    }
}
